<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>
    const weMap=new WeakMap()
    const state=reactive({})
    function reactive(state){
      return new Proxy(state,{
        set(target,key,value,receiver){
          // Reflect用来在对象上设置值会返回Bollean值表示是否成功
          const res=Reflect.set(target,key,value,receiver)
          // 因为此时改变了state中的值 所以此时应该触发依赖收集里的对应的render函数再次渲染该组件
          trigger(target,key)
          return res
        },
        get(target,key,receiver){
          if (typeof target[key]=="object") {
            reactive(target[key])
            return
          }
          const value=Reflect.get(target,key,receiver)
        }
      })
    }
    //['trɪɡər'] 触发依赖收集里的函数
    function trigger(){
        
    }
    //依赖收集
    function track(){
      
    }
  </script>
</body>
</html>